1. Field of the Invention
The present invention relates to an image reading apparatus and a method for controlling the same.
2. Description of the Related Art
There is conventionally known an image reading apparatus, which acquires image data by reading a document and performing print processing based on the acquired image data. In the image reading apparatus, layout processing or sort processing is known as a process for storing image data of a plurality of pages in a storage unit such as a memory and performing print processing based on the image data of the plurality of pages.
The layout processing generates, in order to print image data of N pages in one sheet, a print product by performing layout processing for the image data of the N pages. For example, there is 2-in-1 processing for reducing image data of two pages to generate image data of one page and printing the image data in one sheet.
The sort processing stores the image data of the N pages in the storage unit such as a memory, and then generates a plurality of copies of a print product with the N pages set as one copy by reading the image data of the N pages a plurality of times. For example, there is processing for printing five copies of a print product with image data of ten pages set as one copy.
Performing the layout processing and the sort processing uses a memory for storing the image data of the N pages. However, there is a limit on a memory capacity. When an amount of the stored image data reaches the memory capacity to cause a memory full state before the storage of the image data of the N pages in the memory is completed, input processing of the image data becomes an error.
Concerning a method for dealing with a memory full state, Japanese Patent Laid-Open No. 8-84229 discusses a method for decompressing, when a memory full state occurs during inputting of image data, the compressed image data and recompressing the image data by lower resolution.
However, in the technology discussed in Japanese Patent Application Laid-Open No. 8-84229, there may be an issue of a reduction in image quality of the image data caused by the recompression performed with the lower resolution.
Even when the input processing of the image data is prevented from becoming an error due to the memory full state while avoiding a reduction in image quality, an issue may occur. For example, a method may be employed which stops the inputting of the image data when an amount of the input image data reaches a capacity (threshold capacity), which is smaller than a maximum capacity of a storage area by a predetermined amount for storing the image data. In this case, if the image data stored in the memory is erased with a progress of the print processing, the inputting of the image data can be resumed according to a drop of the amount of the input image data below the threshold capacity.
However, in the case of the layout processing or the sort processing, if the amount of the input image data reaches the threshold capacity before the image data of the N pages is stored in the memory, an error occurs in a state where no print processing is performed.